<?php

/**
 * empresa filter form base class.
 *
 * @package    zobee
 * @subpackage filter
 * @author     Gabriel Martinez Rojas
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseempresaFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'direccion' => new sfWidgetFormFilterInput(),
      'ciudad'    => new sfWidgetFormFilterInput(),
      'pais'      => new sfWidgetFormFilterInput(),
      'telefono'  => new sfWidgetFormFilterInput(),
      'fax'       => new sfWidgetFormFilterInput(),
      'email'     => new sfWidgetFormFilterInput(),
      'web'       => new sfWidgetFormFilterInput(),
      'meta'      => new sfWidgetFormFilterInput(),
      'keywords'  => new sfWidgetFormFilterInput(),
      'title'     => new sfWidgetFormFilterInput(),
      'x'         => new sfWidgetFormFilterInput(),
      'y'         => new sfWidgetFormFilterInput(),
      'zoom'      => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'direccion' => new sfValidatorPass(array('required' => false)),
      'ciudad'    => new sfValidatorPass(array('required' => false)),
      'pais'      => new sfValidatorPass(array('required' => false)),
      'telefono'  => new sfValidatorPass(array('required' => false)),
      'fax'       => new sfValidatorPass(array('required' => false)),
      'email'     => new sfValidatorPass(array('required' => false)),
      'web'       => new sfValidatorPass(array('required' => false)),
      'meta'      => new sfValidatorPass(array('required' => false)),
      'keywords'  => new sfValidatorPass(array('required' => false)),
      'title'     => new sfValidatorPass(array('required' => false)),
      'x'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'y'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'zoom'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('empresa_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'empresa';
  }

  public function getFields()
  {
    return array(
      'id'        => 'Number',
      'direccion' => 'Text',
      'ciudad'    => 'Text',
      'pais'      => 'Text',
      'telefono'  => 'Text',
      'fax'       => 'Text',
      'email'     => 'Text',
      'web'       => 'Text',
      'meta'      => 'Text',
      'keywords'  => 'Text',
      'title'     => 'Text',
      'x'         => 'Number',
      'y'         => 'Number',
      'zoom'      => 'Number',
    );
  }
}
